package sctu.edu.java.year2016.team04.luoxinghua.day20160614.chapter15_1;

import javax.sql.rowset.Joinable;
import javax.swing.*;

/**
 * Created by 落叶的思恋 on 2016/6/15.
 */
public class RunWork15_1 extends JFrame {

    private Thread threadone = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("xiao ming to catch the train");
        }
    });

    private Thread threadtwo = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("The train is coming");
        }
    });
    private Thread threadthree = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("the train stopped he no the train");
        }
    });
    private Thread threadfour = new Thread(new Runnable() {
        @Override
        public void run() {
            System.out.println("the train opened he crying because he was on the wrong train");
        }
    });

    public static void main(String[] args) {
        RunWork15_1 runWork15_1 = new RunWork15_1();
        runWork15_1.threadone.start();
        try {
            runWork15_1.threadone.sleep(10000);

        } catch (Exception e) {
            e.getMessage();
        }
        runWork15_1.threadtwo.start();
        try {
            runWork15_1.threadtwo.sleep(100);
        } catch (Exception e) {
            System.out.println(" if find exception throw " + e.getMessage());
        }
        runWork15_1.threadthree.start();
        try {
            runWork15_1.threadthree.sleep(10000);
        } catch (Exception e) {
            e.getMessage();
        }

        runWork15_1.threadfour.start();
    }
}
